#pragma once
#include"hash.h"

using namespace std;


template<class K, class Hash = HashFunc<K>>
class unordered_set
{
	struct ReturnKey
	{
		const K operator()(const K& key)
		{
			return key;
		}
	};
private:
	typedef HashTable<K, const K, ReturnKey, Hash> HT;
	typedef HashNode<const K> Node;
public:
	typedef typename HT::Iterator iterator;
	typedef typename HT::ConstIterator const_iterator;

	pair<iterator, bool> Insert(const K& key)
	{
		return _ht.Insert(key);
	}

	iterator Find(const K& key)
	{
		return _ht.Find(key);
	}

	bool Erase(const K& key)
	{
		return _ht.Erase(key);
	}

	iterator begin()
	{
		return _ht.Begin();
	}

	const_iterator begin() const
	{
		return _ht.Begin();
	}

	iterator end()
	{
		return _ht.End();
	}

	const_iterator end() const
	{
		return _ht.End();
	}

	int Size()
	{
		return _ht.Size();
	}

private:
	HT _ht;
};
